home *** CD-ROM | disk | FTP | other *** search
/ Amiga News 96 / Amiga News 96.iso / amig_ad_os / avm / prog / source / handlefax.avmsrc < prev    next >
Text File  |  1977-12-31  |  9KB  |  497 lines

  1. startrecord=true
  2. label=
  3. nodetype=7
  4. filename=avm:rexx/stdhead.avm
  5. nextactiontype=3
  6. nextactionaction=
  7. endrecord=true
  8. startrecord=true
  9. label=
  10. nodetype=8
  11. line1=parse arg servername mailbox .
  12. line2=if symbol('mailbox') ~= 'VAR' | mailbox = '' then mailbox = 'manual'
  13. line3=options failat 50
  14. line4=
  15. line5=
  16. line6=
  17. line7=
  18. line8=
  19. line9=
  20. line10=
  21. nextactiontype=3
  22. nextactionaction=
  23. endrecord=true
  24. startrecord=true
  25. label=
  26. nodetype=8
  27. line1='turnoffvoicemode'
  28. line2=
  29. line3=
  30. line4=
  31. line5=
  32. line6=
  33. line7=
  34. line8=
  35. line9=
  36. line10=
  37. nextactiontype=3
  38. nextactionaction=
  39. endrecord=true
  40. startrecord=true
  41. label=
  42. nodetype=6
  43. mode=0
  44. nextactiontype=3
  45. nextactionaction=
  46. endrecord=true
  47. startrecord=true
  48. label=
  49. nodetype=9
  50. baud=4
  51. bits=1
  52. parity=0
  53. stopbits=0
  54. handshaking=1
  55. erroractiontype=3
  56. erroractionaction=
  57. nextactiontype=3
  58. nextactionaction=
  59. endrecord=true
  60. startrecord=true
  61. label=isTrapFax
  62. nodetype=8
  63. line1=faxprogram = upper(getclip('AVMFaxProgram'))
  64. line2=if faxprogram = 'TRAPFAX' then do
  65. line3=
  66. line4=
  67. line5=
  68. line6=
  69. line7=
  70. line8=
  71. line9=
  72. line10=
  73. nextactiontype=3
  74. nextactionaction=
  75. endrecord=true
  76. startrecord=true
  77. label=
  78. nodetype=8
  79. line1=call showDebugger('Starting TrapFax reception.')
  80. line2=call time('r')
  81. line3=
  82. line4=/*----------------------------------------*/
  83. line5=address rexx 'setuptfax.avm'
  84. line6=/*----------------------------------------*/
  85. line7=
  86. line8=
  87. line9=
  88. line10=
  89. nextactiontype=3
  90. nextactionaction=
  91. endrecord=true
  92. startrecord=true
  93. label=
  94. nodetype=11
  95. line1=ATA
  96. timeout=10
  97. swallowecho=1
  98. timedoutactiontype=0
  99. timedoutactionaction=stdtimedout
  100. abortactiontype=0
  101. abortactionaction=stdabort
  102. erroractiontype=0
  103. erroractionaction=stderror
  104. nextactiontype=3
  105. nextactionaction=
  106. endrecord=true
  107. startrecord=true
  108. label=
  109. nodetype=8
  110. line1=address command "trapfax:tfaxdoor getty"
  111. line2=faxResult = rc
  112. line3=call showDebugger('TrapFax reception ' || time('e'))
  113. line4=
  114. line5=
  115. line6=
  116. line7=
  117. line8=
  118. line9=
  119. line10=
  120. nextactiontype=3
  121. nextactionaction=
  122. endrecord=true
  123. startrecord=true
  124. label=isGPFax
  125. nodetype=8
  126. line1=end; else if faxprogram = 'GPFAX' then do
  127. line2=
  128. line3=
  129. line4=
  130. line5=
  131. line6=
  132. line7=
  133. line8=
  134. line9=
  135. line10=
  136. nextactiontype=3
  137. nextactionaction=
  138. endrecord=true
  139. startrecord=true
  140. label=
  141. nodetype=8
  142. line1=call showDebugger('Starting GPFax reception.')
  143. line2=call time('r')
  144. line3=
  145. line4=
  146. line5=
  147. line6=
  148. line7=
  149. line8=
  150. line9=
  151. line10=
  152. nextactiontype=3
  153. nextactionaction=
  154. endrecord=true
  155. startrecord=true
  156. label=
  157. nodetype=8
  158. line1=address rexx_gpfax 'listen'
  159. line2=address rexx_gpfax 'recfax'
  160. line3=faxresult = rc
  161. line4=address rexx_gpfax 'unlisten'
  162. line5=
  163. line6=call showDebugger('GPFax result is' faxresult)
  164. line7=call showDebugger('GPFax done ' || time('e'))
  165. line8=
  166. line9=
  167. line10=
  168. nextactiontype=3
  169. nextactionaction=
  170. endrecord=true
  171. startrecord=true
  172. label=isEFax
  173. nodetype=8
  174. line1=end; else if faxprogram = 'EFAX' then do
  175. line2=
  176. line3=/* create a unique filename */
  177. line4=efaxFileName = makeUniqueFile()
  178. line5=call time('r')
  179. line6=address command 'avm:gnu/efax -p' servername '-r' voiceFile(mailbox, efaxFileName)
  180. line7=faxResult = rc
  181. line8=efaxLength = time('e')
  182. line9=
  183. line10=
  184. nextactiontype=3
  185. nextactionaction=
  186. endrecord=true
  187. startrecord=true
  188. label=
  189. nodetype=8
  190. line1=end
  191. line2=
  192. line3=
  193. line4=
  194. line5=
  195. line6=
  196. line7=
  197. line8=
  198. line9=
  199. line10=
  200. nextactiontype=3
  201. nextactionaction=
  202. endrecord=true
  203. startrecord=true
  204. label=doneRecFax
  205. nodetype=16
  206. timeout=2
  207. abortactiontype=0
  208. abortactionaction=stdabort
  209. erroractiontype=0
  210. erroractionaction=stderror
  211. nextactiontype=3
  212. nextactionaction=
  213. endrecord=true
  214. startrecord=true
  215. label=
  216. nodetype=11
  217. line1=AT+FCLASS=0
  218. timeout=10
  219. swallowecho=1
  220. timedoutactiontype=0
  221. timedoutactionaction=stdtimedout
  222. abortactiontype=0
  223. abortactionaction=stdabort
  224. erroractiontype=0
  225. erroractionaction=stderror
  226. nextactiontype=3
  227. nextactionaction=
  228. endrecord=true
  229. startrecord=true
  230. label=
  231. nodetype=10
  232. timeout=2
  233. valueactiontype=3
  234. valueactionaction=
  235. timedoutactiontype=3
  236. timedoutactionaction=
  237. abortactiontype=0
  238. abortactionaction=stdabort
  239. erroractiontype=0
  240. erroractionaction=stderror
  241. nextactiontype=3
  242. nextactionaction=
  243. endrecord=true
  244. startrecord=true
  245. label=
  246. nodetype=10
  247. timeout=2
  248. valueactiontype=3
  249. valueactionaction=
  250. timedoutactiontype=3
  251. timedoutactionaction=
  252. abortactiontype=0
  253. abortactionaction=stdabort
  254. erroractiontype=0
  255. erroractionaction=stderror
  256. nextactiontype=3
  257. nextactionaction=
  258. endrecord=true
  259. startrecord=true
  260. label=createLog
  261. nodetype=8
  262. line1=handle = makeUniqueFile()
  263. line2=call initLogEntry()
  264. line3=
  265. line4=
  266. line5=
  267. line6=
  268. line7=
  269. line8=
  270. line9=
  271. line10=
  272. nextactiontype=3
  273. nextactionaction=
  274. endrecord=true
  275. startrecord=true
  276. label=
  277. nodetype=8
  278. line1=log.comment = ''
  279. line2=log.type = 'Fax tried'
  280. line3=
  281. line4=if faxprogram = 'GPFAX' then do
  282. line5=  if faxresult <= 5 then signal gotfaxgpfax
  283. line6=end; else if faxprogram = 'TRAPFAX' then do
  284. line7=  call open('cfaxlstfl', 'trapfax:trapfax.log', 'r')
  285. line8=  call open('cfaxnrfl', 'trapfax:incoming/trapfax.sequence', 'r')
  286. line9=  cfaxnr = readln('cfaxnrfl')
  287. line10=  cnewfaxnr = right(cfaxnr, 4, '0')
  288. nextactiontype=3
  289. nextactionaction=
  290. endrecord=true
  291. startrecord=true
  292. label=
  293. nodetype=8
  294. line1=  do forever
  295. line2=    cfax = readln('cfaxlstfl')
  296. line3=    cfaxlsnr = right(left(cfax, 6), 4)
  297. line4=    if cfaxlsnr = cfaxnr | eof('cfaxlstfl') then break
  298. line5=  end
  299. line6=  call close('cfaxlstfl'); call close('cfaxnrfl')
  300. line7=  langGerKey = right(left(cfax, 21), 1)
  301. line8=  if left(cfax, 1) ~= 'E' & left(cfax, 1) ~= 'F' then signal gotfaxtrapfax
  302. line9=end; else if faxprogram = 'EFAX' then do
  303. line10=
  304. nextactiontype=3
  305. nextactionaction=
  306. endrecord=true
  307. startrecord=true
  308. label=
  309. nodetype=8
  310. line1=if exists(voiceFile(mailbox, efaxFileName) || '.001') then signal gotfaxefax
  311. line2=end
  312. line3=
  313. line4=
  314. line5=
  315. line6=
  316. line7=
  317. line8=
  318. line9=
  319. line10=
  320. nextactiontype=3
  321. nextactionaction=
  322. endrecord=true
  323. startrecord=true
  324. label=
  325. nodetype=8
  326. line1=
  327. line2=
  328. line3=
  329. line4=
  330. line5=
  331. line6=
  332. line7=
  333. line8=
  334. line9=
  335. line10=
  336. nextactiontype=0
  337. nextactionaction=finished
  338. endrecord=true
  339. startrecord=true
  340. label=gotfaxgpfax
  341. nodetype=8
  342. line1=address rexx_gpfax 'reportlog' 1
  343. line2=
  344. line3=faxfilename = result
  345. line4=log.filename = result
  346. line5=
  347. line6=
  348. line7=
  349. line8=
  350. line9=
  351. line10=
  352. nextactiontype=3
  353. nextactionaction=
  354. endrecord=true
  355. startrecord=true
  356. label=
  357. nodetype=8
  358. line1=
  359. line2=address rexx_gpfax 'reportlog' 6
  360. line3=log.length = result
  361. line4=address rexx_gpfax 'reportlog' 2
  362. line5=log.comment = result 'page(s) received.'
  363. line6=
  364. line7=
  365. line8=
  366. line9=
  367. line10=
  368. nextactiontype=3
  369. nextactionaction=
  370. endrecord=true
  371. startrecord=true
  372. label=
  373. nodetype=8
  374. line1=address rexx_gpfax 'reportlog' 4
  375. line2=log.returnnumber = result
  376. line3=log.type = 'fax'
  377. line4=
  378. line5=
  379. line6=
  380. line7=
  381. line8=
  382. line9=
  383. line10=
  384. nextactiontype=0
  385. nextactionaction=finished
  386. endrecord=true
  387. startrecord=true
  388. label=gotfaxtrapfax
  389. nodetype=8
  390. line1=if langGerKey ='E' then faxfilename = 'trapfax:incoming/Empfangen-' || cfaxnr || '.FAX'
  391. line2=else faxfilename = 'trapfax:incoming/In-' || cfaxnr || '.FAX'
  392. line3=log.filename = faxfilename;myvar = right(left(cfax, 54), 5)
  393. line4=myvar = (left(myvar, 2)*60) + (right(myvar, 2))
  394. line5=log.length = myvar
  395. line6=myvar = right(left(cfax, 47), 2); myvar = strip(myvar, 'L')
  396. line7=log.comment = myvar 'page(s)'
  397. line8=myvar = right(left(cfax, 45), 22)
  398. line9=myvar = strip(myvar, 'T')
  399. line10=log.returnnumber = myvar; log.type = 'fax'
  400. nextactiontype=0
  401. nextactionaction=finished
  402. endrecord=true
  403. startrecord=true
  404. label=gotfaxefax
  405. nodetype=8
  406. line1=log.filename = efaxFileName
  407. line2=faxfilename = efaxFileName
  408. line3=log.type = 'fax'
  409. line4=
  410. line5=log.length = efaxLength
  411. line6=base = voiceFile(mailbox, efaxFileName) || '.'
  412. line7=do i = 1 to 999
  413. line8=  if ~exists(base || right(i, 3, '0')) then break
  414. line9=end
  415. line10=log.comment = i - 1 'pg'; if (i > 2) then log.comment = log.comment || 's'
  416. nextactiontype=3
  417. nextactionaction=
  418. endrecord=true
  419. startrecord=true
  420. label=
  421. nodetype=8
  422. line1=log.returnNumber = getclip(upper(servername || '.faxid'))
  423. line2=
  424. line3=
  425. line4=
  426. line5=
  427. line6=
  428. line7=
  429. line8=
  430. line9=
  431. line10=
  432. nextactiontype=0
  433. nextactionaction=finished
  434. endrecord=true
  435. startrecord=true
  436. label=finished
  437. nodetype=8
  438. line1=log.origMailbox = mailbox
  439. line2=call saveLogEntry(mailbox, handle)
  440. line3=
  441. line4=
  442. line5=
  443. line6=
  444. line7=
  445. line8=
  446. line9=
  447. line10=
  448. nextactiontype=3
  449. nextactionaction=
  450. endrecord=true
  451. startrecord=true
  452. label=
  453. nodetype=8
  454. line1=call loadMailbox(mailbox)
  455. line2=if upper(log.type) = 'FAX' & mailbox.autofaxforwardb = 1 & mailbox.autofaxforwardscript ~= "" then do
  456. line3=  handle = makeUniqueFile()
  457. line4=  call initLogEntry(); log.origmailbox = mailbox
  458. line5=  log.filename = voiceFile(mailbox, faxfilename); log.type = 'fax'
  459. line6=  log.returnsendfunc = mailbox.autofaxforwardscript; log.returninterval = 5
  460. line7=  log.returnretry = 3; log.returnnumber = mailbox.autofaxforward
  461. line8=  call saveLogEntry('Outgoing', handle)
  462. line9=end
  463. line10=
  464. nextactiontype=3
  465. nextactionaction=
  466. endrecord=true
  467. startrecord=true
  468. label=
  469. nodetype=8
  470. line1=
  471. line2=
  472. line3=
  473. line4=
  474. line5=
  475. line6=
  476. line7=
  477. line8=
  478. line9=
  479. line10=
  480. nextactiontype=2
  481. nextactionaction=exit
  482. endrecord=true
  483. startrecord=true
  484. label=
  485. nodetype=7
  486. filename=avm:rexx/simplestdtail.avm
  487. nextactiontype=3
  488. nextactionaction=
  489. endrecord=true
  490. startrecord=true
  491. label=
  492. nodetype=7
  493. filename=avm:rexx/mailboxfunctions.avm
  494. nextactiontype=3
  495. nextactionaction=
  496. endrecord=true
  497.